package com.gwu.manger.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.gwu.manger.comm.RedisConfig;


@Service
public class RedisService {
	@Value("${spring.redis.db-manager}")
    int dbManager;
    @Value("${spring.redis.db-default}")
    int dbDefault;
    @Autowired
    RedisConfig redisConfig;

    
   /**
    * 
    * @param key
    * @return 根据key获取对应值
    */
    public Object getKey(String key ){
    	return redisConfig.get(key , dbDefault);
    }
    
    
    /**
     * 
     * @param key
     * @return 根据key获取对应值
     */
     public void setKey(String key,Object value){
     	 redisConfig.set(key ,value, dbDefault);
     }
    
  
}
